package cn.tedu.forum.passport.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户登录数据传输类
 *
 * @author DunJu Zhou
 */

@Data
@Accessors(chain = true)
public class LoginDTO implements Serializable {

    @ApiModelProperty(value = "密码", example = "123456", required = true)
    @NotNull(message = "登录失败，必须提交密码！")
    @Pattern(regexp = ".{3,30}", message = "登录失败失败，密码必须是3~30位任意字符！")
    private String password;

    @ApiModelProperty(value = "联系电话", example = "12345678901")
    @NotNull(message = "登录失败，必须提交联系电话！")
    @Pattern(regexp = "\\d{11}", message = "登录失败失败，电话号码格式错误！")
    private String phoneNumber;

    /*@ApiModelProperty(value = "电子邮箱", example = "abc@123.com")
    private String emailAddress;*/

    /*@ApiModelProperty(value = "联系方式（电话或邮箱）", example = "12345678901/abc@123.com")
    private String contactInfo;*/

    private Integer remember; // 记住用户名和密码（0=不记住，1=记住）
}
